
<script type="text/javascript" src="/um/umeditor.config.js"></script>
<script type="text/javascript" src="/um/umeditor.min.js"></script>
<link href="/um/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<div class="row">
<div class="row" >
	<div class="col-md-3 col-md-offset-8">
		<img src="/src/img/wz.png">
	</div>
</div>
<div class="row" style="background-color:rgb(245,247,250)">

<div class="col-md-3" style="border:solid 1px rgb(221,221,221)">
	<div class="row" style="background-color:rgb(249,249,249)">
		<div class="row">
			<img src="{$_SESSION['uid']|uidimage}" class="img-circle center-block" width="120px"  style="border:solid 1px rgb(221,221,221);padding:5px;margin-top:-60px" id="imgch">
			<input type="file" name="image" class="hide" id="change" accept="image/png,image/gif,image/jpg,image/jpeg">
		</div>
		<p class="text-center" style="font-size:25px">
			{$_SESSION['uid']|uidname}
		</p>
		

	</div>
	<div class="row" style="background-color:rgb(251,252,253);border:solid 1px rgb(221,221,221)">
		<p class="text-center">
			上次登入
			<br>
			IP：{$info['lastip']}
			<br>
			时间:{$info['lasttime']|date="Y-m-d H:i:s",###}

		</p>


	</div>
	<div class="row" style="background-color:rgb(249,249,249);border:solid 1px rgb(221,221,221)">
		<br>
		<p class="text-center">
			<a href="/index.php/User/change" class="btn btn-info">修改密码</a>
		</p>
		<p class="text-center">
			<span class="btn btn-warning" data-toggle="modal" data-target="#joininfo">登入历史</span>
		</p>




<!-- Modal -->
<div class="modal fade" id="joininfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">我的登入历史</h4>
      </div>
      <div class="modal-body">
      	<table class="table table-striped">
      		<tr>
      			<th>
      				登入时间
      			</th>
      			<th>
      				登入IP
      			</th>
      		</tr>
      		<?php $joininfo=json_decode($info['joininfo'],true) ?>
           	<volist name="joininfo" id="info">
           		<tr>
           			<td>
           				{$info[lasttime]|date="Y-m-d H:i:s",###}
           			</td>
           			<td>
           				{$info[lastip]}
           			</td>
           		</tr>
      		</volist>
      	</table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>

      </div>
    </div>
  </div>
</div>


		<p class="text-center">
			<a href="/index.php/User/logout" class="btn btn-danger">注销登入</a>
		</p>
		<div class="text-center">
			<p >
				<a href="/index.php/User/index" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-open"> 投稿管理</span></a>
			</p>
			<p >
				<a href="/index.php/User/mark" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-folder-open"> 收藏夹</span></a>
			</p>
			<p>
				<a href="/index.php/User/tx" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-comment"> 消息</span></a>
			</p>
		</div>
	</div>	
</div>
<div class="col-md-9" style="border:solid 1px rgb(221,221,221)">
	<div class="row" style="border:solid 1px rgb(221,221,221)">	
		<ul class="nav nav-pills">
			<li  class="active"><a href="">文章投稿</a></li>
			<li><a href="/index.php/User/old">往期投稿</a></li>
		</ul>
	</div>
	<div class="row" style="margin:10px;background-color:rgb(255,255,255);border:solid 1px rgb(221,221,221);padding:15px">
		<form method="post" action="/index.php/Post/send" class="form-horizontal" enctype="multipart/form-data" >
		<div class="row" style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">标题</span>
				</label>
				<div class="col-sm-9 text-right" >
					<input type="text" name="title" placeholder="请输入文章标题" class="form-control" style="margin-top:5px">
				</div>
			</div>
		</div>
		<div class="row" style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">简介</span>
				</label>
				<div class="col-sm-9 text-right" >
						<textarea name="miao" placeholder="请输入文章简介.简介中不得包含令人反感的信息，且长度应在10到255个字符之间。" class="form-control" style="margin-top:5px"></textarea>
				</div>
			</div>
		</div>
		<div class="row" style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">标签</span>
				</label>
				<div class="col-sm-9 text-right" >
					<input type="text" name="tag" placeholder="请输入文章标签" class="form-control" style="margin-top:5px">
				</div>
			</div>
		</div>
		<div class="row" style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">频道</span>
				</label>
				<div class="col-sm-3 text-right" >
						<select name="pd" class="form-control" style="margin-top:5px">
							<option value="zh">综合</option>
							<option value="yx">游戏</option>
							<option value="mh">漫画.小说</option>
							<option value="dm">动漫文化</option>
							<option value="gz">工作.感情</option>
						</select>
				</div>
			</div>
		</div>
		<div class="row" style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">封面图片</span>
				</label>
				<div class="col-sm-7" >
					<span id="image" class="btn btn-info glyphicon glyphicon-picture" style="margin-top:5px">上传本地图片</span>
					<input id="btnimage" type="file" name="image" placeholder="请输入文章标签" class="hide" style="margin-top:5px">
					<p style="color:rgb(153,153,153)">
					请选择您的文章封面图片。封面图片不得包含令人反感的信息，尺寸为480*270像素。请勿使用与内容无关，或分辨率不为16:9的图片作为封面图片。
					</p>
				</div>
				<div class="col-sm-3 ">
					<img src="/src/img/cover.png" width="144px" height="81px" id="up" style="margin-top:5px">
				</div>
			</div>
		</div> 
		<div class="row"  style="border-bottom:dashed 1px rgb(221,221,221)">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span style="background-color:rgb(238,238,238);color:rgb(102,102,102);font-size:18px;border-radius:2px;padding:5px">正文</span>
				</label>
				<div class="col-sm-9 " >
						<textarea name="text"  id="um"  style="margin-top:5px;height:450px;width:700px"></textarea>
				</div>
			</div>
			<div class="col-md-12">
				<p class="alert alert-success" >
				确认文章信息无误后，点击下方左侧“提交投稿”按钮提交投稿。
				</p>
			</div>
		</div>
		<div class="row" >
			<div class="col-sm-3">
				<button class="btn btn-success" style="margin:10px"><span class="glyphicon glyphicon-ok-circle">提交投稿</span></button>
			</div>
			<div class="col-sm-3 col-sm-offset-6 text-right"> 
				<a href="" class="btn btn-primary" style="margin:10px"><span class="glyphicon glyphicon-circle-arrow-right"></span>提交反馈</a>
			</div>
		</div>
		</form>

	</div>	
</div>
</div>
</div>

<script type="text/javascript">
        var um = UM.getEditor('um',{toolbar:["source | undo redo | emotion image | bold italic underline strikethrough | forecolor backcolor | superscript subscript | removeformat |","insertorderedlist insertunorderedlist | selectall cleardoc | fontfamily fontsize paragraph","| justifyleft justifycenter justifyright justifyjustify |","link unlink ","| horizontal print preview fullscreen","drafts"]});
</script>

<script type="text/javascript">
	$("#image").click(function(){
		$("#btnimage").click();
	})	
	$("#btnimage").change(function(){
		file=this.files[0];
		var fr=new FileReader();
		fr.readAsDataURL(file);
		fr.onload=function(e){
			$("#up").attr("src",this.result);
		}
	})
	$("#imgch").click(function(){
		$("#change").click();
	})
	$("#change").change(function(){
		var fd=new FormData();
		fd.append("image",this.files['0']);
		$.ajax({
			url:"/index.php/User/image",
			data:fd,
			type:"POST",
			 processData: false,  // 告诉jQuery不要去处理发送的数据

             contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
			success:function(data){
				location.reload();
			}
		})
	})
</script>
